package com.beta.em.admins;

import java.util.Objects;

/**
 * Created by lichao on 2017/1/17.
 */
public enum LedgerStatus{
    ACTIVE("active","已激活"),
    FROZEN("frozen","冻结");
    private String value;
    private String CnValue;

    LedgerStatus(String value, String cnValue) {
        this.value = value;
        CnValue = cnValue;
    }

    public static LedgerStatus getLedgerStatus(String value){
        for (LedgerStatus status:values()) {
            if(status.value.equals(value)){
                return status;
            }
        }
        return null;
    }

    public static String getCnValue(String value){
        LedgerStatus ledgerStatus = getLedgerStatus(value);
        if(Objects.nonNull(ledgerStatus)) {
            return ledgerStatus.CnValue;
        }
        else
            return null;
    }
}
